import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: lucky
 * Date: 2022-10-21
 * Time: 9:44
 */

@WebServlet("/hello")
public class HelloServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
//        super.doGet(req, resp);
        //让服务器在自己的控制台例打印
        System.out.println("hello world");
//        在页面上也能打印、把hello world支付穿，放到Http servlet这个类中
        //显示到页面上vc
        resp.getWriter().write("hello world" + System.currentTimeMillis());
    }
}
